//搜索,导出
$('#search-btn').click(function(){
	var sn = $('#sn').val();
	var cid = $('#cid').val();
	var name = $('#name').val();
	var topStatus = $('#topStatus').val();
	var trademarkStatus = $('#trademarkStatus').val();
	var reqUrl = "/member2024/best";
	reqUrl +=( sn ? "/sn/" + sn : "" )
	reqUrl +=( cid ? "/cid/" + cid : "" )
	reqUrl +=( name ? "/name/" + name : "")
	reqUrl +=( topStatus ? "/topStatus/" + topStatus : "")
	reqUrl +=( trademarkStatus ? "/trademarkStatus/" + trademarkStatus : "") +".html";
	window.location.href = reqUrl;
});
// 全选
$('input[name="checkall"]').click(function(){
	if(this.checked){
		$('input:checkbox[name="trademark"]').prop("checked", true);
	}else{
		$('input:checkbox[name="trademark"]').prop("checked", false);
	}
});
//删除精选
$(".delBest").click(function (){
	$(this).blur();
	var id = $(this).attr("trademarkid");
	$.ajax({
		url   : '/member2024/delBest',
		data  :{id: id},
		cache : false,
		async : false,
		type  : "POST",
		dataType : 'json',
		success  : function (result){
			if(result.status == 0){
				return errmsg(result.msg);
			}else{
				window.location.reload();
				return false;
			}
		}
	});
});
//设置置顶
$(".setTop").click(function (){
	$(this).blur();
	var id = $(this).attr("trademarkid");
	$.ajax({
		url   : '/member2024/setTop',
		data  :{id: id},
		cache : false,
		async : false,
		type  : "POST",
		dataType : 'json',
		success  : function (result){
			if(result.status == 0){
				return errmsg(result.msg);
			}else{
				window.location.reload();
				return false;
			}
		}
	});
});
//取消置顶
$(".cancelTop").click(function (){
	$(this).blur();
	var id = $(this).attr("trademarkid");
	$.ajax({
		url   : '/member2024/cancelTop',
		data  :{id: id},
		cache : false,
		async : false,
		type  : "POST",
		dataType : 'json',
		success  : function (result){
			if(result.status == 0){
				return errmsg(result.msg);
			}else{
				window.location.reload();
				return false;
			}
		}
	});
});

